package com.lhy.ltss.dao;

import com.lhy.ltss.entity.Address;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AddressDao {
    @Insert("insert into address(username,name,tel,address) values(#{username},#{name},#{tel},#{address})")
    int add(Address address);

    @Delete("delete from address where id=#{id}")
    int remove(Integer id);

    @Select("select * from address where username=#{username}")
    List<Address> find(String username);

    @Select("select * from address where id=#{id}")
    Address findById(Integer id);
}
